Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ut for trigger/broker updates check immutable #4843

Merged

Conversation

vaikas
Copy link
Contributor

@vaikas vaikas commented Feb 5, 2021

Proposed Changes

  • While we have tests for CheckImmutableFields, we did not have UT for running through the actual update, so added those for v1/v1beta1 broker/trigger.

Release Note

:bug: Fix bug where v1beta1 would allow mutations to immutable fields. v1beta1 trigger.spec.broker is immutable.

Docs

@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label Feb 5, 2021
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 5, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vaikas

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 5, 2021
@zhongduo
Copy link
Contributor

zhongduo commented Feb 5, 2021

/lgtm

@knative-prow-robot knative-prow-robot added lgtm Indicates that a PR is ready to be merged. and removed lgtm Indicates that a PR is ready to be merged. labels Feb 5, 2021
@vaikas
Copy link
Contributor Author

vaikas commented Feb 5, 2021

Thanks @zhongduo I had forgotten to add the actual missing logic to the commit, ut catches it, right on :) PTAL :)

@codecov
Copy link

codecov bot commented Feb 5, 2021

Codecov Report

Merging #4843 (0ea788b) into master (b887ac4) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4843      +/-   ##
==========================================
+ Coverage   81.29%   81.35%   +0.05%     
==========================================
  Files         292      292              
  Lines        8326     8322       -4     
==========================================
+ Hits         6769     6770       +1     
+ Misses       1147     1144       -3     
+ Partials      410      408       -2     
Impacted Files Coverage Δ
pkg/adapter/mtping/runner.go 86.27% <100.00%> (+1.79%) ⬆️
pkg/apis/eventing/v1beta1/trigger_validation.go 89.85% <100.00%> (+0.46%) ⬆️
pkg/apis/eventing/v1beta1/broker_validation.go 86.66% <0.00%> (+10.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b887ac4...d11de38. Read the comment docs.

@zhongduo
Copy link
Contributor

zhongduo commented Feb 5, 2021

Thanks @zhongduo I had forgotten to add the actual missing logic to the commit, ut catches it, right on :) PTAL :)

That's the best you can ask for from ut! :)

@vaikas vaikas force-pushed the ut-for-broker-trigger-updates branch from d05fc30 to f182539 Compare February 8, 2021 14:56
@knative-prow-robot knative-prow-robot added the area/test-and-release Test infrastructure, tests or release label Feb 9, 2021
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/eventing/v1beta1/broker_validation.go 88.0% 96.0% 8.0
pkg/apis/eventing/v1beta1/trigger_validation.go 96.3% 96.5% 0.2

@vaikas
Copy link
Contributor Author

vaikas commented Feb 9, 2021

@zhongduo I updated the conformance tests. PTAL.

@zhongduo
Copy link
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 10, 2021
@knative-prow-robot knative-prow-robot merged commit c4e9c3b into knative:master Feb 10, 2021
@vaikas vaikas deleted the ut-for-broker-trigger-updates branch February 10, 2021 15:54
@vaikas
Copy link
Contributor Author

vaikas commented Feb 10, 2021

/cherry-pick release-0.20
/cherry-pick release-0.19
/cherry-pick release-0.18

@knative-prow-robot
Copy link
Contributor

@vaikas: new pull request created: #4864

In response to this:

/cherry-pick release-0.20
/cherry-pick release-0.19
/cherry-pick release-0.18

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@vaikas
Copy link
Contributor Author

vaikas commented Mar 8, 2021

/cherry-pick release-0.20
Trying again, can't figure out how to rebase the other one, so trying this instead.

@knative-prow-robot
Copy link
Contributor

@vaikas: new pull request could not be created: failed to create pull request against knative/eventing#release-0.20 from head knative-prow-robot:cherry-pick-4843-to-release-0.20: status code 422 not one of [201], body: {"message":"Validation Failed","errors":[{"resource":"PullRequest","code":"custom","message":"A pull request already exists for knative-prow-robot:cherry-pick-4843-to-release-0.20."}],"documentation_url":"https://docs.github.com/rest/reference/pulls#create-a-pull-request"}

In response to this:

/cherry-pick release-0.20
Trying again, can't figure out how to rebase the other one, so trying this instead.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@vaikas
Copy link
Contributor Author

vaikas commented Mar 8, 2021

/cherry-pick release-0.20
Trying again, can't figure out how to rebase the other one, so trying this instead.

@knative-prow-robot
Copy link
Contributor

@vaikas: new pull request created: #5026

In response to this:

/cherry-pick release-0.20
Trying again, can't figure out how to rebase the other one, so trying this instead.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants